<template>
    <div class="mui-numbox" data-numbox-min='1' data-numbox-max='max'>
        <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
        <input id="test" class="mui-input-numbox" type="number" ref="numbox" @change="countChanged" value="1" />
        <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
    </div>
    
</template>
<script>
import mui from "../../libs/mui/js/mui.min.js"
export default {
    data(){
return { }
    },
    props:["max"],
    mounted(){
        mui('.mui-numbox').numbox();
    },
    watch:{
      max:function(newvalue){
          mui(".mui-numbox").numbox().setOption('max',newvalue)
      }
    },
    methods:{
        countChanged(){
            this.$emit("getcount",parseInt(this.$refs.numbox.value))
        }
    }
};
</script>
<style lang="scss" scoped>
</style>
